/*
 * CoordExtractWithoutMarker.h
 * Created on: 04/04/2011
 * Author: catharine
 */

#include <vector>
#include <utility>

#ifndef COORDEXTRACTWITHOUTMARKER_H_
#define COORDEXTRACTWITHOUTMARKER_H_

#include "ExtratorDeCampos.h"
#include "Rotation.h"
#include "Auxiliar.h"
#include "PreProcessamentoSemMarcadores.h"
#include "TipoDoCampo.h"


using namespace std;

class ExtratorDeCamposSemMarcadores: public ExtratorDeCampos {
public:
	ExtratorDeCamposSemMarcadores();
	virtual ~ExtratorDeCamposSemMarcadores();


        Estrutura* encontrarCampos(IplImage* sum);

protected:
        vector<Campo* > achaCamposAPartirDeLinhaEColuna(Vector<pair<int, int> > columns,
		Vector<pair<int, int> > lines);

	Vector< pair<int,int> > horizontalCoordinates(IplImage * src);
	Vector< pair<int,int> > verticalCoordinates(IplImage * src);
        static void sumLines(IplImage * image, double * sumLines, int height, int width);
        void sumColumns(IplImage * image, double * sumLines, int height, int width);
	void findTableLines(double * sumTableLines, double * sumDst, int maxValue,
			int delta);
	Vector< pair<int,int> > findCoordinatesLines(double * sum, int sumSize);
};

#endif /* COORDEXTRACTWITHOUTMARKER_H_ */
